Skip to content

feat(remote-feature-flag-controller): segment threshold flags by metaMetricsFlags with canonical ID default - #9325

Merged
mcmire merged 27 commits into
mainfrom
feat/remote-feature-flag-threshold-groups-clean
Aug 20, 2026
Merged

feat(remote-feature-flag-controller): segment threshold flags by metaMetricsFlags with canonical ID default#9325
mcmire merged 27 commits into
mainfrom
feat/remote-feature-flag-threshold-groups-clean

Conversation

@asalsys

@asalsys asalsys commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add required getCanonicalProfileId constructor callback and metaMetricsFlags map for threshold flag segmentation.
  • Threshold flags use canonical profile ID by default; flags whose names are present in metaMetricsFlags use MetaMetrics ID instead.
  • Generalize threshold calculation to hash the selected segmentation ID while preserving the existing deterministic bucketing behavior.
  • Pass the new segmentation options through @metamask/wallet remote feature flag controller initialization.

Segmentation Behavior

Flag configuration Identifier used Constructor callback
Flag name absent from metaMetricsFlags Canonical profile ID getCanonicalProfileId()
Flag name present in metaMetricsFlags MetaMetrics ID getMetaMetricsId()

If the selected identifier is empty, threshold arrays are preserved as-is and not processed.

Example threshold config using canonical segmentation by default:

{
  "myCanonicalFlag": [
    {
      "name": "groupA",
      "scope": { "type": "threshold", "value": 0.5 },
      "value": "valueA"
    },
    {
      "name": "groupB",
      "scope": { "type": "threshold", "value": 1.0 },
      "value": "valueB"
    }
  ]
}

Example controller setup for a flag that should keep MetaMetrics segmentation:

new RemoteFeatureFlagController({
  // ...
  getMetaMetricsId,
  getCanonicalProfileId,
  metaMetricsFlags: {
    legacyMetaMetricsFlag: true,
  },
});

Migration

Consumers must pass getCanonicalProfileId for threshold flags that should use canonical profile segmentation, which is now the default for flags absent from metaMetricsFlags.

Existing threshold flags that must keep MetaMetrics-based bucketing should be listed in metaMetricsFlags and continue to provide getMetaMetricsId.

Test plan

  • yarn workspace @metamask/remote-feature-flag-controller run jest --no-coverage src/utils/user-segmentation-utils.test.ts src/remote-feature-flag-controller.test.ts
  • Threshold flags absent from metaMetricsFlags use getCanonicalProfileId for segmentation
  • Threshold flags present in metaMetricsFlags use getMetaMetricsId for segmentation
  • Threshold arrays are preserved when the selected identifier is empty
  • Threshold cache entries use the selected segmentation ID and stale entries are cleaned up when flags are removed from the server response

Related


Note

Medium Risk
Breaking constructor and experiment-assignment change: existing threshold flags will re-bucket unless listed in metaMetricsFlags. Not auth or payment logic, but it can change live A/B group membership.

Overview
Breaking: threshold flags now bucket by canonical profile ID by default instead of MetaMetrics ID. RemoteFeatureFlagController requires getCanonicalProfileId; flags listed in optional metaMetricsFlags still use getMetaMetricsId.

Hash-based assignment hashes the chosen segmentation ID. If that ID is empty, the threshold array is left unprocessed. Explicit MetaMetrics ID targeting is unchanged. Threshold cache keys and stale-entry cleanup cover both identifiers.

@metamask/wallet forwards the new options (optional; empty-string default for canonical ID). Consumers that need the old MetaMetrics bucketing must list those flag names in metaMetricsFlags.

Reviewed by Cursor Bugbot for commit 09b141f. Bugbot is set up for automated code reviews on this repo. Configure here.

…y and support canonical id segmentation

Threshold flags now expose selected values directly, track group names in
featureFlagThresholdGroups, and can use getCanonicalId when idType is canonical.

Co-authored-by: Cursor <cursoragent@cursor.com>
@asalsys
asalsys requested review from a team as code owners June 30, 2026 23:04
@asalsys
asalsys temporarily deployed to default-branch June 30, 2026 23:04 — with GitHub Actions Inactive
Comment thread packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts Outdated
@asalsys asalsys changed the title feat(remote-feature-flag-controller): return threshold values directly and track threshold groups feat(remote-feature-flag-controller): segment threshold flags by idType with canonical ID default Jul 1, 2026
…nd changelog links

Default threshold segmentation to canonical ID, link changelog entries to
PR #9325, add wallet changelog entry, and fix ESLint violations.

Co-authored-by: Cursor <cursoragent@cursor.com>
@asalsys
asalsys enabled auto-merge July 1, 2026 03:11

@NicolasMassart NicolasMassart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments, one blocking and a nit.

Comment thread packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts Outdated
@asalsys asalsys changed the title feat(remote-feature-flag-controller): segment threshold flags by idType with canonical ID default feat(remote-feature-flag-controller): segment threshold flags by metaMetricsFlags with canonical ID default Jul 6, 2026
@asalsys
asalsys requested a review from NicolasMassart July 6, 2026 21:25
NicolasMassart
NicolasMassart previously approved these changes Jul 7, 2026
NicolasMassart
NicolasMassart previously approved these changes Jul 7, 2026
mcmire
mcmire previously approved these changes Aug 19, 2026

@mcmire mcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davidmurdoch davidmurdoch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why this change is needed, but have left a comment about the API anyway.

Comment thread packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts Outdated
Cal-L added 2 commits August 19, 2026 14:30
…hub.com:MetaMask/core into feat/remote-feature-flag-threshold-groups-clean
@Cal-L
Cal-L dismissed stale reviews from mcmire and weitingsun via bff707e August 19, 2026 21:30

@davidmurdoch davidmurdoch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the reason for this. but from a code and api standpoint, it looks good.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 09b141f. Configure here.

@mcmire
mcmire disabled auto-merge August 20, 2026 15:47
@mcmire
mcmire added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit a511a46 Aug 20, 2026
204 checks passed
@mcmire
mcmire deleted the feat/remote-feature-flag-threshold-groups-clean branch August 20, 2026 15:48
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
pull Bot pushed a commit to Reality2byte/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([MetaMask#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([MetaMask#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([MetaMask#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot added a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
vpintorico pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 9, 2026
….3` (#46177)

- chore: bump `@metamask/wallet` to `^12.0.3` cp-13.48.0 (#45749)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Bumping `@metamask/wallet` to `^12.0.0`

```markdown
## [12.0.0]

### Added

- Add optional `instanceOptions.remoteFeatureFlagController.getCanonicalProfileId` constructor option to `RemoteFeatureFlagController` for threshold flag segmentation ([#9325](MetaMask/core#9325))
- Add optional `instanceOptions.remoteFeatureFlagController.metaMetricsFlags` constructor option to `RemoteFeatureFlagController` to segment flags by MetaMetrics ID ([#9325](MetaMask/core#9325))
- **BREAKING:** Wire `ConfigRegistryApiService` and `ConfigRegistryController` into the default wallet initialization ([#9928](MetaMask/core#9928))
  - Adds a required `configRegistryApiService` slot to `instanceOptions` with a required `env` (`ConfigRegistryApiEnv`) and optional `fetch` and `policyOptions`. `fetch` defaults to `globalThis.fetch` via `ConfigRegistryApiService`.
  - Adds an optional `configRegistryController` slot to `instanceOptions` for optional `pollingInterval` and `fallbackConfig`.
  - `ConfigRegistryController` delegates `KeyringController:getState`, `RemoteFeatureFlagController:getState`, and `ConfigRegistryApiService:fetchConfig`, and subscribes to `KeyringController:unlock`, `KeyringController:lock`, and `RemoteFeatureFlagController:stateChange`.
  - Consumers that pass their own root messenger and already wire `ConfigRegistryApiService` / `ConfigRegistryController` must remove their own before upgrading, or the duplicate registration will collide.
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to: https://consensyssoftware.atlassian.net/browse/WPN-1879

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling

guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches remote feature flag segmentation, persisted state migration,
and moves config registry initialization into wallet—behavior changes at
sign-in and upgrade paths warrant careful QA.
> 
> **Overview**
> Upgrades **`@metamask/wallet`** to **^12.0.3** with
**`@metamask/config-registry-controller` ^3** and
**`@metamask/remote-feature-flag-controller` ^6.1.1**, and removes the
extension’s duplicate **Config Registry** messenger-client init so
**`ConfigRegistryController`** / **`ConfigRegistryApiService`** are
owned by the wallet (including new
**`getConfigRegistryApiServiceInstanceOptions`** with PRD vs UAT env
from build type).
> 
> **Remote feature flags** are updated for RFFC 6:
**`getCanonicalProfileId`** (from **`AuthenticationController`**,
MetaMetrics fallback), safer early-init ID resolution, and
**`setupRemoteFeatureFlagToggle`** now listens for auth state changes
and **force-refreshes** flags when the canonical profile id appears or
changes. Migration **224.1** strips persisted
**`rawRemoteFeatureFlags`** so old redacted cache is not reused.
> 
> E2E fixtures/mocks and LavaMoat policies are adjusted for
threshold-flag shape and wallet-owned packages.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
967b8ce. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
[1fc81a2](1fc81a2)

---------

Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Cal Leung <cleun007@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: mikesposito <michele@esposito.codes>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants